<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Userlist</title>
    {% load static %}
    <link rel="stylesheet" href="{% static 'bootstrap-3.4.1-dist/css/bootstrap.min.css' %}">
    <script src="{% static 'bootstrap-3.4.1-dist/js/bootstrap.min.js' %}"></script>
</head>
<body>
<h1 class="text-center">用户列表</h1>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
           <table class="table table-striped table-hover">
               <thead>
                <tr>
                    <th>ID</th>
                    <th>username</th>
                    <th>password</th>
                    <th>action</th>
                </tr>
               </thead>
               <tbody>
                    {% for user_obj in res %}
                        <tr>
                            <td>{{ user_obj.id }}</td>
                            <td>{{ user_obj.username }}</td>
                            <td>{{ user_obj.password }}</td>
                            <td>
                                <a href="/edit/?user_id={{ user_obj.id }}" class="btn btn-primary btn-xs">编辑</a>
                                <a href="/delete/?user_id={{ user_obj.id }}" class="btn btn-danger btn-xs">删除</a>
                            </td>
                        </tr>
                    {% endfor %}
               </tbody>
           </table>
        </div>
    </div>
</div>
</body>
</html>